package com.dkm.orproject.dkmoa.service.serviceimpl.flow;

import com.dkm.orproject.dkmoa.dao.OaEntryFamilyMapper;
import com.dkm.orproject.dkmoa.domain.OaEntryFamily;
import com.dkm.orproject.dkmoa.service.flow.OaEntryFamilyService;
import com.dkm.orproject.utils.utils.IdToobtainUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @PROJECT_NAME: orproject
 * @DESCRIPTION:
 * @USER: 周佳佳
 * @DATE: 2020/8/11 13:55
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class OaEntryFamilyServiceimpl implements OaEntryFamilyService {
    @Autowired
    OaEntryFamilyMapper oaEntryFamilyMapper;
    @Autowired
    IdToobtainUtils toobtainUtils;
    /**
     * 人员信息增加语句
     * @param record 对象
     * @return 返回行数
     */
    @Override
    public int insertSelective(OaEntryFamily record) {
        record.setPkFamilyId(toobtainUtils.getNumberId());
        return oaEntryFamilyMapper.insertSelective(record);
    }

    /**
     * 根据主键查询
     * @param pkFamilyId 主键
     * @return 返回数据
     */
    @Override
    public OaEntryFamily selectByPrimaryKey(Long pkFamilyId) {
        return oaEntryFamilyMapper.selectByPrimaryKey(pkFamilyId);
    }


    /**
     * 修改或逻辑删除
     * @param record 对象
     * @return 返回操作行数
     */
    @Override
    public int updateByPrimaryKeySelective(OaEntryFamily record) {
        return oaEntryFamilyMapper.updateByPrimaryKeySelective(record);
    }

    /**
     * 根据人员id查询家庭信息
     * @param entryId 流程id
     * @return 返回集合
     */
    @Override
    public List<OaEntryFamily> selectAll(Long entryId) {
        return oaEntryFamilyMapper.selectAll(entryId);
    }

    /**
     * 根据人员id查询家庭信息(人员信息变更流程)
     * @param entryId 流程id
     * @return 返回集合
     */
    @Override
    public List<OaEntryFamily> selectAlls(Long entryId) {
        return oaEntryFamilyMapper.selectAlls(entryId);
    }
}
